#include <stdio.h>
#include <stdlib.h>
int g=998;
int main(void)
{
    //栈--》堆
    int *p=malloc(20);



    //堆-->栈
    int a=100;
    int **m=malloc(sizeof(int *));
    *m=&a;
    **m=200;
    printf("%d\n",a);

    //堆->>堆
    int *pa=malloc(sizeof(int));
    int **pm=malloc(sizeof(int*));
    *pm=pa;
    *pa=100;
    **pm=300;
    printf("%d\n",*pa);
    
    //栈指向数据段
    int *px=&g;

    //数据段指向栈
     int sa=666;
     static int *psa;
     psa=&sa;
     *psa=667;
     printf("%d\n",*psa);


     //数据段-->堆
     static int **psq;
     int *sq=malloc(20);
     *psq=sq;
     
     







}